<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:include page="../include/header.jsp" />
<script type="text/javascript" src="<c:url value='/htmlRes/js/tableAddDelete.js'/>"></script>
<script type="text/javascript" src="<c:url value='/htmlRes/js/datepicker/jquery.ui.core.js'/>"></script>
<script type="text/javascript" src="<c:url value='/htmlRes/js/datepicker/jquery.ui.datepicker.js'/>"></script>
<script type="text/javaScript">
<!--
	/* pagination 페이지 링크 function */
	function listPage(){
		$('#writeForm').attr('action', '<c:url value="/repairSystem/repairSystemList.do"/>');
		$('#writeForm').submit();
	}
	
	function saveFormPage() {
		$('#writeForm').attr('action', '<c:url value="/repairSystem/repairSystemSave.do"/>');
		$('#writeForm').submit();
	}
	
	function deletePage() {
		if(confirm('삭제하시겠습니까?')){
			$('#writeForm').attr('action', '<c:url value="/repairSystem/repairSystemDelete.do"/>');
			$('#writeForm').submit();
		}
	}
	
	$(document).ready(function(){
		$('#currentSystemFind').click(function(e){
			e.preventDefault();
			window.open("<c:url value='/repairSystem/searchCurrentSystem.do' />?areaKey=${resultVO.srs_area_key }", "POP_CURRENTSYSTEMFIND", 'width=600, height=600, scrollbars=yes, menubar=no, toolbar=no, resizable=no, status=yes');
		});
		
		$( "#srs_trbl_date" ).datepicker();
		$( "#srs_rept_date" ).datepicker();
		$( "#srs_repr_date" ).datepicker();
	});
-->
</script>
<!-- contents s -->
<div class="container" id="container">
	<span class="round lt">&nbsp;</span>
    <span class="round rt">&nbsp;</span>
    <span class="round lb">&nbsp;</span>
    <span class="round rb">&nbsp;</span>
    <div class="container_area">
    	<form name="writeForm" id="writeForm" action="<c:url value="/repairSystem/repairSystemWriteForm.do"/>" method="post">
			<input type="hidden" name="srs_repr_key" id="srs_repr_key" value="${resultVO.srs_repr_key }"/>
			<input type="hidden" name="srs_area_key" id="srs_area_key" value="${resultVO.srs_area_key }"/>
        <h2 class="tit_h2">고장/조치 현황 등록</h2>
            <jsp:include page="../include/navi.jsp" />
            <div class="table_wrap"><!-- D : table은 div table_wrap 싸고감 -->
                <table summary="고장/조치 현황 등록" class="table_write">
                    <caption>고장/조치 현황 등록</caption>
                    <colgroup> <!-- D : col width로 테이블 넓이 조절 -->
                        <col width="15%" />
                        <col width="35%" />
                        <col width="15%" />
                        <col width="55%" />
                    </colgroup>
                    <tbody>
                        <tr>
                            <th scope="row"><label for="scs_sys_num">품명</label></th>
                            <td class="alL" colspan="3">
                            	<input type="text" name="srs_sys_name" id="srs_sys_name" value="${resultVO.srs_sys_name }" style="width:80%;"/>
                            	<span style="color:red">${error_srs_sys_name }</span>
                            	<a href="#currentSystemFind" class="btn_tb" id="currentSystemFind">품명 찾기</a>
                            </td>
                        </tr>
                        <tr>
                        	<th scope="row"><label for="srs_trbl_date">고장일자</label></th>
                            <td class="alL"><input type="text" name="srs_trbl_date" id="srs_trbl_date" value="${resultVO.srs_trbl_date }" style="width:100%;"/></td>
                            <th scope="row"><label for="srs_trbl_desc">내용</label></th>
                            <td class="alL"><input type="text" name="srs_trbl_desc" id="srs_trbl_desc" value="${resultVO.srs_trbl_desc }" style="width:100%;"/></td>
                        </tr>
                        <tr>
                            <th scope="row"><label for="srs_rept_date">보고일자</label></th>
                            <td class="alL"><input type="text" name="srs_rept_date" id="srs_rept_date" value="${resultVO.srs_rept_date }" style="width:100%;"/></td>
                            <th scope="row"><label for="srs_rept_desc">내용</label></th>
                            <td class="alL"><input type="text" name="srs_rept_desc" id="srs_rept_desc" value="${resultVO.srs_rept_desc }" style="width:100%;"/></td>
                        </tr>
                        <tr>
                            <th scope="row"><label for="srs_repr_date">수리일자</label></th>
                            <td class="alL"><input type="text" name="srs_repr_date" id="srs_repr_date" value="${resultVO.srs_repr_date }" style="width:100%;"/></td>
                            <th scope="row"><label for="srs_repr_desc">내용</label></th>
                            <td class="alL"><input type="text" name="srs_repr_desc" id="srs_repr_desc" value="${resultVO.srs_repr_desc }" style="width:100%;"/></td>
                        </tr>
                        <tr>
                            <th scope="row"><label for="srs_etc_info">기타</label></th>
                            <td class="alL" colspan="3"><textarea name="srs_etc_info" id="srs_etc_info" cols="50" rows="30">${resultVO.srs_etc_info }</textarea>
                        </tr>
                    </tbody>                        
                </table>
            </div><!--//table_wrap-->
            <div class="btn_bbs">
            	<a href="<c:url value='/repairSystem/repairSystemList.do' />" onclick="listPage();return false;" class="btn_wh">목록</a>
            	<a href="<c:url value="/repairSystem/repairSystemSave.do" />" onclick="saveFormPage();return false;" class="btn_re">저장</a>
            	<c:if test="${not empty resultVO.srs_repr_key }">
	            	<a href="<c:url value="/repairSystem/repairSystemDelete.do" />" onclick="deletePage();return false;" class="btn_gy">삭제</a>
            	</c:if>
            </div>
            <!-- 검색조건 유지 -->
			<input type="hidden" name="pageIndex" id="pageIndex" value="${resultVO.pageIndex }"/>
    	</form>
    </div><!--//container_area-->
</div>
<!-- contents e -->
<jsp:include page="../include/footer.jsp" flush="true"/>
<jsp:include page="../include/messagealert.jsp" />